home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmigaPlus / Begleitmaterial / 50Tools / Grafik / PerfectPaint / rexx / box / Cloud_II.rx < prev    next >
Text File  |  2002-03-08  |  3KB  |  158 lines

  1. /* Box arexx test */
  2.  
  3.     options results
  4.   parse ARG Port x1 y1 x2 y2 b
  5.     ADDRESS value Port
  6.  
  7.     Nbx=50
  8.     Nx=100
  9.     T=0
  10.     N=0
  11.  
  12.     IF EXISTS('PerfectPaint:Prefs/Rexx_Prefs/PerlinCloud') THEN DO
  13.         IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/PerlinCloud', "R") then DO
  14.             N = READLN('lfile')
  15.             Nbx = READLN('lfile')
  16.             Nx = READLN('lfile')
  17.             T = READLN('lfile')
  18.             CALL CLOSE('lfile')
  19.         END
  20.     END
  21.  
  22.     pp_GetLocale 142
  23.     Title=result
  24.     pp_DialogInit 230 95 Title||"*II" 4
  25.         pp_GetLocale 329
  26.         pp_Integer 0 100 5 50 16 result||"*(%)" 1 Nbx
  27.         pp_CheckBox 3 155 7 16 16 "" 0 N
  28.         pp_GetLocale 103
  29.         pp_Integer 2 100 25 50 16 result||"*(%)" 1 Nx
  30.         pp_GetLocale 39
  31.         pp_Cycle   1 100 45 80 16 result 1 "R0|R1|R2|R3|R4|R5|R6|R7|R8|R9" T
  32.     pp_Dialog
  33.     rc=result
  34.     IF rc=0 then EXIT
  35.  
  36.     pp_GetDialog 0
  37.     Nbx=result
  38.  
  39.     pp_GetDialog 1
  40.     T=result
  41.  
  42.     pp_GetDialog 2
  43.     Nx=result
  44.  
  45.     pp_GetDialog 3
  46.     N=result
  47.  
  48.     CALL SavePrefs('PerlinCloud',N,Nbx,Nx,T)
  49.  
  50.   w=abs(x2-x1)+1
  51.   h=abs(y2-y1)+1
  52.  
  53.     pp_ClosestColor 0 0 0
  54.     Black=result
  55.     pp_ClosestColor 255 255 255
  56.     White=result
  57.  
  58.     pp_GetCurrentBuffer
  59.     CBf=result
  60.     pp_GetCurrentBrush
  61.     CB=result
  62.  
  63.     pp_FindEmptyBuffer
  64.     Bf=result
  65.     if Bf=-1 then DO
  66.         pp_Warn "can't*find*empty|Buffer."
  67.         EXIT        
  68.     END
  69.  
  70.     pp_FindEmptyBrush
  71.     Brush=result
  72.     if Brush=-1 then DO
  73.         pp_Warn "can't*find*empty|Brush."
  74.         EXIT        
  75.     END
  76.     pp_SetBrush Brush        
  77.  
  78.     pp_ProgressText Title||"*II"
  79.     Amp=10
  80.     pp_SetBuffer Bf
  81.     pp_ComposeReqOff
  82.  
  83.     
  84.     pp_New w h 24
  85.     pp_AvoidRefresh
  86.   pp_SpareOnOff
  87.  
  88.     pp_Progress 0 Amp
  89.   pp_setApen Black
  90.   pp_SetBpen White
  91.   pp_Spray 1 100
  92.  
  93.     pp_Progress 1 Amp
  94.   pp_effectOn
  95.   pp_Boxf 0 0 w h
  96.  
  97.     pp_Progress 2 Amp    
  98.     pp_PickBrush 0 0 w h 1
  99.  
  100.     pp_SpareOnOff
  101.  
  102.     i=2
  103.     Do j=0 to 4
  104.         pp_Progress j+3 Amp
  105.         i=i*2
  106.         pp_EffectOff
  107.         pp_Plot w/2 h/2
  108.         pp_EffectOn
  109.         pp_Compose 0 100 0 
  110.         pp_Mosaic i
  111.         pp_Boxf 0 0 w h
  112.         pp_Blur i/2
  113.         pp_Boxf 0 0 w h
  114.         pp_Spare
  115.          pp_Compose 0 50 0
  116.         pp_Boxf 0 0 w h
  117.         if j<5 then pp_PicttoSpare
  118.     END
  119.  
  120.     pp_Progress 7 Amp    
  121.   if N=1 then pp_AdjustLevels 150-(Nbx*1.5) 200
  122.  
  123.     pp_Progress 8 Amp
  124.     pp_Colorize T+2
  125.     pp_Boxf 0 0 w h    
  126.  
  127.     pp_Progress 9 Amp
  128.     pp_Compose 0 100 0     
  129.     pp_EffectOff
  130.     pp_FreeBrush
  131.     pp_SetBrush CB
  132.     pp_PermitRefresh
  133.  
  134.     pp_SetBuffer CBf
  135.   pp_UpdateUndoBox x1-1 y1-1 x2+1 y2+1
  136.     pp_Progress 10 Amp
  137.     pp_ComposeBuffer x1+w/2 y1+h/2 Nx Bf
  138.   pp_ClearBuffer Bf
  139.     pp_ProgressClr
  140.     pp_ComposeReqOn
  141.  
  142.     Exit
  143.  
  144. SavePrefs: PROCEDURE
  145.     Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
  146.     if EXISTS(Prefname) THEN DO
  147.         ADDRESS COMMAND
  148.         'delete >nil: '||Prefname
  149.     END
  150.     IF OPEN('pfile',PrefName,'W') THEN DO
  151.     do i=2 to ARG()
  152.         CALL WRITELN('pfile',ARG(i))
  153.     end
  154.     CALL CLOSE('pfile')
  155. RETURN
  156.  
  157.  
  158.